package com.swanclouds.model.managers;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.ModelEntity;

/**
 * @author 李文强
 * description
 */

public class SetKvmKey implements ModelEntity {

    //key标识符，10进制整数
    @JsonProperty("Id")
    private Integer id;

    //key标识符扩展，任意32位16进制数组成的字符串
    @JsonProperty("IdExt")
    private String idExt;

    //加密key值, 任意64位16进制数组成的字符串
    @JsonProperty("SecretKey")
    private String secretKey;

    //key模式,包括：
    //Shared：共享
    //Private：独占
    @JsonProperty("Mode")
    private String mode;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIdExt() {
        return idExt;
    }

    public void setIdExt(String idExt) {
        this.idExt = idExt;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public static  SetKvmKey builder(){
        return new SetKvmKey();
    }

    public SetKvmKey id(Integer id){
        this.id = id;
        return this;
    }

    public SetKvmKey idExt(String idExt){
        this.idExt = idExt;
        return this;
    }

    public SetKvmKey secretKey(String secretKey){
        this.secretKey = secretKey;
        return this;
    }

    public SetKvmKey mode(String mode){
        this.mode = mode;
        return this;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "SetKvmKey{" +
                "id=" + id +
                ", idExt='" + idExt + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", mode='" + mode + '\'' +
                '}';
    }
}
